package com.yenlien.traceyun.plant.controller;

import com.yenlien.traceyun.plant.dao.FarmDao;
import com.yenlien.traceyun.plant.service.PlantService;
import com.yenlien.traceyun.webase.controller.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: bigwangy@sina.com
 * @create: 2020-12-21
 * @description:
 **/

@RestController
@RequestMapping("/planttrace")
public class PlantTraceController extends BaseController {

    @Autowired
    public PlantService plantService;

    @Autowired
    private FarmDao farmDao;

    /**
     * 获取农事信息
     *
     * @param plantId
     * @return
     */
    @GetMapping(value = "/farm/{plantId}")
    public Object plantfarm(@PathVariable("plantId") String plantId) {
        return farmDao.findJobDetailByPlantId(plantId);
    }


}
